package cn.ymjr.business.service;

import cn.ymjr.business.entity.SysUserAddress;
import cn.ymjr.business.form.ExplainForm;
import cn.ymjr.business.form.OrderForm;
import cn.ymjr.business.form.StartForm;
import cn.ymjr.sys.config.exception.BusinessException;
import cn.ymjr.sys.util.Result;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Tiny
 * @create 2022/4/1 17:54
 */
public interface BusinessService {

    Result nameExplain(ExplainForm explainForm,String token) throws BusinessException;

    Result activityList(Integer page,Integer pageSize);

    Result activityDetail(Integer id);

    Result goodsCategory();

    Result goodsList(Integer page,Integer pageSize,Integer category);

    Result goodsDetail(Integer id);

    Result informationList(Integer page,Integer pageSize,Integer userId,Integer category);

    Result infoDetail(Integer id);
    @Transactional
    Result infoStar(StartForm startForm, String token)throws BusinessException;

    Result myInfo(Integer page,Integer pageSize,Integer userId,String token)throws BusinessException;

    @Transactional
    Result editAddress(SysUserAddress sysUserAddress, String token)throws BusinessException;

    Result addressList(Integer userId, Integer page, Integer pageSize, String token)throws BusinessException;
    @Transactional
    Result submitOrder(OrderForm orderForm, String token)throws BusinessException;

    Result orderList(Integer userId, Integer page, Integer pageSize, Integer orderStatus);

    Result orderPay(Integer orderId, String token, HttpServletRequest request)throws BusinessException;
    @Transactional
    String callBack(HttpServletRequest request, HttpServletResponse response)throws Exception;

    Result ensureOrder(Integer userId, Integer orderId, String token)throws BusinessException;
    @Transactional
    Result cancel(Integer orderId,Integer userId,String token)throws BusinessException;
}
